package com.yh.create.factoryMethod;

/**
 * Created by Rocky on 2018/7/25.
 */
public class HumanFactory {

    public static Human createHuman(Class clazz) {
        Human man = null;

        try {

            man = (Human) Class.forName(clazz.getName()).newInstance();
        } catch (Exception e) {
            System.out.println("人种有问题");
        }

        return man;
    }
}
